package name.fowler.refactoring.simplestore.reports;

import name.fowler.refactoring.simplestore.reports.Formatter.Format;

public class FormatterFactory {

    private static HtmlFormatter htmlFormatter = new HtmlFormatter();
    private static PlainFormatter plainFormatter = new PlainFormatter();
    private static PdfFormatter pdfFormatter = new PdfFormatter();

    public static Formatter getFormatter(Format format) {
        switch (format) {
            case PLAIN:
                return plainFormatter;
            case HTML:
                return htmlFormatter;
            case PDF:
                return pdfFormatter;
            default:
                return null;
        }
    }
}
